//
//  WJDelegateAController.m
//  JerryIos
//
//  Created by 王军 on 2018/2/6.
//  Copyright © 2018年 王军. All rights reserved.
//

#import "WJDelegateAController.h"
#import "WJDelegateBController.h"

@interface WJDelegateAController () <WJDelegateBControllerDelegate>

@end

@implementation WJDelegateAController

- (void)viewDidLoad {
    [super viewDidLoad];
}


- (IBAction)valueBtnClick:(id)sender {
    WJDelegateBController *bController = [[WJDelegateBController alloc] init];
    //设置下一个控制器的代理是自己（很重要）
    bController.delegate = self;
    bController.param = @"value9898989";
    [self.navigationController pushViewController:bController animated:YES];
}

//实现代理的方法
-(void) returnDataFromController:(WJDelegateBController *)viewController withData:(NSString *)data {
    //为控件赋值
    self.resultLabel.text = data;
}

@end
